<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title><?php echo $this->_tpl_vars['softtitle'] ?></title>
<link href="templates/css/baselist.css" rel="stylesheet" type="text/css" />
<link href="templates/css/all.css" rel="stylesheet" type="text/css" />
<link href="templates/css/clickmenu.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/form.js"></script>
<script type="text/javascript" src="js/control.js"></script>
<script type="text/javascript">

	var resizewindow= null;

	window.onresize = function(){
		var h = $(window).height();
		if(resizewindow!=h){
			sizewindow();
			resizewindow=h;
		}
	}

	function sizewindow(){
		var h = $(window).height();
		if(document.getElementById("mainbodyauto")){
			$('.manageadd').css({height:h-40});
		}
	}
	var article_js_noselect_empty  = "<?php echo $this->_tpl_vars['ST']['article_js_noselect_empty'] ?>";
	var article_doc_add_tid  = "<?php echo $this->_tpl_vars['ST']['article_doc_add_tid'] ?>";
	var article_js_doc_add_ok = "<?php echo $this->_tpl_vars['ST']['article_js_doc_add_ok'] ?>";
	var article_js_doc_add_no = "<?php echo $this->_tpl_vars['ST']['article_js_doc_add_no'] ?>";
	var iframename = "<?php echo $this->_tpl_vars['iframename'] ?>" ? "jerichotabiframe_0" : "<?php echo $this->_tpl_vars['iframename'] ?>";
	iframename = iframename=='' ? "jerichotabiframe_0" : iframename;
	$(document).ready(function(){
		var h = $(window).height();
		$('.manageadd').css({height:h-40});
		var options = {
			beforeSubmit: formverify,
			success:saveResponse,
			resetForm: false
		}
		$('#docbatadd').submit(function() {
			$(this).ajaxSubmit(options);
			return false;
		});
	})




	function formverify(formData, jqForm, options) {
		var queryString = $.param(formData);
		var get=urlarray(queryString);
		if(get['tid']==0){
			document.docbatadd.tid.focus();
			alert(article_doc_add_tid+article_js_noselect_empty);
			return false;
		}
		parent.windowsdig('Loading','iframe:index.php?archive=management&action=load','400px','180px','iframe',false);
	}
	function saveResponse(options){
		parent.closeifram();
		if (options=='true'){
			if(parent.frames[iframename].document.getElementById("articleselectform")){
				parent.frames[iframename].refresh('articleselectform','articleselectall','articlecheck_all');
			}
			alert(article_js_doc_add_ok);
		}else{
			alert(article_js_doc_add_no+'Return message:'+options);
		}
		parent.onaletdoc();
	}
</script>
</head>

<body>
<form name="docbatadd" id="docbatadd" method="post" action="index.php?archive=article&action=docbatsave" enctype="multipart/form-data">
	<input type="hidden" name="tab" id="docaddtab" value="<?php echo $this->_tpl_vars['tab'] ?>">
	<input type="hidden" name="mid" id="mid" value="<?php echo $this->_tpl_vars['mid'] ?>">
	<input type="hidden" name="lng" id="lng" value="<?php echo $this->_tpl_vars['lng'] ?>">
	<div id="mainbodyauto" class="manageadd">
		<div class="maindobycontent">
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2"><?php echo $this->_tpl_vars['ST']['article_doc_add_typeinfotext'] ?></span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_tid'] ?></td>
						<td width="85%" class="trtitle02">
							<select size="1" name="tid" id="tid">
								<option selected="selected" value="0"><?php echo $this->_tpl_vars['ST']['article_doc_add_tid_option'] ?></option>
								<?php if (count($this->_tpl_vars['typelist'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['typelist']); $list++){?>
								<option <?php echo $this->_tpl_vars['typelist'][$list]['selected'] ?> value="<?php echo $this->_tpl_vars['typelist'][$list]['tid'] ?>"><?php echo $this->treelist($this->_tpl_vars['typelist'][$list]['level'],'&nbsp;&nbsp;&nbsp;') ?>├─ <?php echo $this->_tpl_vars['typelist'][$list]['typename'] ?></option>
								<?php }} ?>
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_extid'] ?></td>
						<td width="85%" class="trtitle02">
							<select size="3" name="extid[]" id="extid" multiple="multiple">
								<optgroup label="<?php echo $this->_tpl_vars['ST']['article_doc_add_extid_option'] ?>">
								<?php if (count($this->_tpl_vars['typelist'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['typelist']); $list++){?>
								<option value="<?php echo $this->_tpl_vars['typelist'][$list]['tid'] ?>"><?php echo $this->treelist($this->_tpl_vars['typelist'][$list]['level'],'&nbsp;&nbsp;&nbsp;') ?>├─ <?php echo $this->_tpl_vars['typelist'][$list]['typename'] ?></option>
								<?php }} ?>
								</optgroup>
							</select>
						</td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_sid'] ?></td>
						<td width="85%" class="trtitle02">
							<select size="1" name="sid" id="sid">
								<option selected="selected" value="0"><?php echo $this->_tpl_vars['ST']['article_doc_add_sid_option'] ?></option>
								<?php if (count($this->_tpl_vars['subjectlistarray'])>0){$divid_list=1;for($list=0;$list<count($this->_tpl_vars['subjectlistarray']); $list++){?>
								<option value="<?php echo $this->_tpl_vars['subjectlistarray'][$list]['sid'] ?>"><?php echo $this->_tpl_vars['subjectlistarray'][$list]['subjectname'] ?></option>
								<?php }} ?>
							</select>
						</td>
					</tr>
				</table>
			</div>
			<div class="sugtitle">
				<span class="sugtitleicon"><span class="strong colorgorning2"><?php echo $this->_tpl_vars['ST']['article_doc_add_titletext2'] ?></span></span>
			</div>
			<div class="sugtitle-line"></div>
			<div class="formdiv">
				<table border="0" width="100%">
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"><?php echo $this->_tpl_vars['ST']['article_doc_add_batfile'] ?></td>
						<td width="85%" class="trtitle02"><input type="file" name="batfile" size="40" maxlength="200" id="batfile" class="infoInput"/></td>
					</tr>
					<tr class="trstyle2">
						<td width="15%" class="trtitle01"></td>
						<td width="85%" class="trtitle02 colorghow lineheight160"><?php echo $this->_tpl_vars['ST']['article_doc_add_batfile_mess_text'] ?></td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	<div id="downbotton">
		<div id="subbotton">
			<table border="0" width="100%">
				<tr>
					<td id="right"><input type="submit" id="docaddsubmitbotton" name="Submit" value="<?php echo $this->_tpl_vars['ST']['botton_add'] ?>" class="buttonface" /></td>
					<td id="left" class="padding-left5"><input type="button" name="cancel" onClick="javascript:parent.onaletdoc();" value="<?php echo $this->_tpl_vars['ST']['botton_add_reset'] ?>" class="buttonface" /></td>
				</tr>
			</table>
		</div>
	</div>
</form>
</body>

</html>


